<layout name='Layout/layout_main' />
<script type="text/javascript" src="__PUBLIC__/js/calendar.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery-ui.min.js"></script>
	<script type="text/javascript">
		function showdata(){				
			y = $("#year").val();
			m = $("#month").val();
			$("#panel").html(y + "年" + m + "月");
			start_date1 = $("#UL0").attr("class").substr(4);
			end_date1 = $("#UL41").attr("class").substr(4);
			$.getJSON("{:U('json')}", {
				start_date : start_date1,
				end_date : end_date1
			}, function(data){					
				count = 0;
				prev_date = '';
				$(".mv-container ul").html("");
				if (data != null) {					
					$.each(data, function(i) {
						html = '<li id=li_' + data[i].id + ' style=background-color:' + schedule_bg(data[i].priority) + ">";
						html += '<a id=' + data[i].id + ' class="event_msg" title="' + data[i].name + '">';
						html += data[i].name;
						html += ' </a>';
						html += "</li>";
						if (prev_date == data[i].start_date) {
							count++;
							if (count == 4) {
								$("ul.div_" + data[i].start_date).append('<li class=\"all\">显示全部...</li>');
							}
						}
						prev_date = data[i].start_date;
						$("ul.div_" + data[i].start_date).append(html);
					})
				}
			});
		}

		$(document).ready(function() {
			initial();
			set_return_url();

			$("a.event_msg").live("click", (function() {
				var msg_list = "";
				current = $(this).attr('id');
				$("a#" + current).parent().parent().find('a.event_msg').each(function() {
					msg_list += $(this).attr("id") + "|";
				});
				winopen("{:U('read')}?id=" + $(this).attr('id') + "&list=" + msg_list,730, 490);
			}))
			$("#dialog2").mouseleave(function() {
				$("#dialog2").hide();
			});
			$("li.all").live("click",(function(){
				$(this).parent().find("li.all").hide();
				html = $(this).parent().html();
				$(this).parent().find("li.all").show();
				html = $("<ol></ol>").html(html);
				$("#dialog2").html(html);
				$("#dialog2").show();				

				$("#dialog2").css("left",$(this).parents("ul").offset().left- $(".Schedule").offset().left);
				$("#dialog2").css("top",$(this).parents("ul").offset().top-$(".Schedule").offset().top);						
			}))
		})
		//-->
		function add() {
			window.open("{:U('add')}", "_self");
		}

		function month_view() {
			window.open('__URL__', "_self");
		}

		function day_view() {
			window.open("{:U('day_view')}", "_self");
		}
	</script>
<div id="cal" class="schedule">
	<div id="top" class="operate panel panel-default"><div class="panel-body">
		<div class="pull-left">
			<a id="panel" class="btn btn-default"></a>
			<a onclick="pushBtm('MU');" class="btn btn-default"> <b>&#60;</b>
			</a>
			<a onclick="pushBtm('MD');" class="btn btn-default"> <b>&#62;</b>
			</a>
			<a onclick="pushBtm('');" class="btn btn-default">今天</a>
			<input type="text" name="start_date" id="start_date" style="display:none">
			<input type="text" name="end_date" id="end_date" style="display:none"></div>
		<div class="pull-right">
			<a onclick="month_view();" class="btn btn-default">月视图</a>
			<a onclick="day_view();" class="btn btn-default">日视图</a>
			<a onclick="add();" class="btn btn-default">新建</a>
		</div>
	</div>	</div>
	<form method="post" action="" name="CLD">
		<div style="display:none"> <font>公历
				<select id="year" onchange=changeCld() name=SY>
					<script language=JavaScript>
						for ( i = 1900; i < 2050; i++)
							document.write('<option>' + i)</script>
				</select>
				年
				<select id="month" onchange=changeCld() name=SM>
					<script language=JavaScript>
						for ( i = 1; i < 13; i++)
							document.write('<option>' + i)</script>
				</select>
				月</font>  <font id="GZ"></font>
		</div>
		<div style="height:760px;">
			<div class="mv-container">
				<table class="mv-daynames-table" cellspacing="0" cellpadding="0">
					<tbody>
						<tr>
							<th title="周日" class="mv-dayname">周日</th>
							<th title="周一" class="mv-dayname">周一</th>
							<th title="周二" class="mv-dayname">周二</th>
							<th title="周三" class="mv-dayname">周三</th>
							<th title="周四" class="mv-dayname">周四</th>
							<th title="周五" class="mv-dayname">周五</th>
							<th title="周六" class="mv-dayname">周六</th>
						</tr>
					</tbody>
				</table>
				<div class="mv-event-container" id="mvEventContainer">
					<div class="month-row" style="top: 0%; height: 17.66%;">
						<table class="st-bg-table" cellspacing="0" cellpadding="0">
							<tbody>
								<tr>
									<td class="st-bg ">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
								</tr>
							</tbody>
						</table>
						<table class="st-grid" cellspacing="0" cellpadding="0">
							<tbody>
								<tr>
									<td class="st-dtitle   ">
										<span class="left" id="SD0"></span>
										<span class="right hidden-phone" id="LD0"></span>
									</td>
									<td class="st-dtitle  ">
										<span class="left" id="SD1"></span>
										<span class="right hidden-phone" id="LD1"></span>
									</td>
									<td class="st-dtitle  ">
										<span class="left" id="SD2"></span>
										<span class="right hidden-phone" id="LD2"></span>
									</td>
									<td class="st-dtitle  ">
										<span class="left" id="SD3"></span>
										<span class="right hidden-phone" id="LD3"></span>
									</td>
									<td class="st-dtitle ">
										<span class="left" id="SD4"></span>
										<span class="right hidden-phone" id="LD4"></span>
									</td>
									<td class="st-dtitle ">
										<span class="left" id="SD5"></span>
										<span class="right hidden-phone" id="LD5"></span>
									</td>
									<td class="st-dtitle ">
										<span class="left" id="SD6"></span>
										<span class="right hidden-phone" id="LD6"></span>
									</td>
								</tr>
								<tr>
									<td class="st-c ">
										<ul id="UL0"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL1"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL2"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL3"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL4"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL5"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL6"></ul>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<div class="month-row" style="top: 16.6%; height: 17.66%;">
						<table class="st-bg-table" cellspacing="0" cellpadding="0">
							<tbody>
								<tr>
									<td class="st-bg ">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
								</tr>
							</tbody>
						</table>
						<table class="st-grid" cellspacing="0" cellpadding="0">
							<tbody>
								<tr>
									<td class="st-dtitle ">
										<span class="left" id="SD7"></span>
										<span class="right hidden-phone" id="LD7"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD8"></span>
										<span class="right hidden-phone" id="LD8"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD9"></span>
										<span class="right hidden-phone" id="LD9"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD10"></span>
										<span class="right hidden-phone" id="LD10"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD11"></span>
										<span class="right hidden-phone" id="LD11"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD12"></span>
										<span class="right hidden-phone" id="LD12"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD13"></span>
										<span class="right hidden-phone" id="LD13"></span>
									</td>
								</tr>
								<tr>
									<td class="st-c ">
										<ul id="UL7"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL8"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL9"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL10"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL11"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL12"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL13"></ul>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<div class="month-row" style="top: 33.33%; height: 17.66%;">
						<table class="st-bg-table" cellspacing="0" cellpadding="0">
							<tbody>
								<tr>
									<td class="st-bg ">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
								</tr>
							</tbody>
						</table>
						<table class="st-grid" cellspacing="0" cellpadding="0">
							<tbody>
								<tr>
									<td class="st-dtitle ">
										<span class="left" id="SD14"></span>
										<span class="right hidden-phone" id="LD14"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD15"></span>
										<span class="right hidden-phone" id="LD15"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD16"></span>
										<span class="right hidden-phone" id="LD16"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD17"></span>
										<span class="right hidden-phone" id="LD17"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD18"></span>
										<span class="right hidden-phone" id="LD18"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD19"></span>
										<span class="right hidden-phone" id="LD19"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD20"></span>
										<span class="right hidden-phone" id="LD20"></span>
									</td>
								</tr>
								<tr>
									<td class="st-c ">
										<ul id="UL14"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL15"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL16"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL17"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL18"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL19"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL20"></ul>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<div class="month-row" style="top: 50%; height: 17.66%;">
						<table class="st-bg-table" cellspacing="0" cellpadding="0">
							<tbody>
								<tr>
									<td class="st-bg ">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
								</tr>
							</tbody>
						</table>
						<table class="st-grid" cellspacing="0" cellpadding="0">
							<tbody>
								<tr>
									<td class="st-dtitle ">
										<span class="left" id="SD21"></span>
										<span class="right hidden-phone" id="LD21"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD22"></span>
										<span class="right hidden-phone" id="LD22"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD23"></span>
										<span class="right hidden-phone" id="LD23"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD24"></span>
										<span class="right hidden-phone" id="LD24"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD25"></span>
										<span class="right hidden-phone" id="LD25"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD26"></span>
										<span class="right hidden-phone" id="LD26"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD27"></span>
										<span class="right hidden-phone" id="LD27"></span>
									</td>
								</tr>
								<tr>
									<td class="st-c ">
										<ul id="UL21"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL22"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL23"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL24"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL25"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL26"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL27"></ul>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<div class="month-row" style="top: 66.66%;height:17.66%;">
						<table class="st-bg-table" cellspacing="0" cellpadding="0">
							<tbody>
								<tr>
									<td class="st-bg ">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
								</tr>
							</tbody>
						</table>
						<table class="st-grid" cellspacing="0" cellpadding="0">
							<tbody>
								<tr>
									<td class="st-dtitle ">
										<span class="left" id="SD28"></span>
										<span class="right hidden-phone" id="LD28"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD29"></span>
										<span class="right hidden-phone" id="LD29"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD30"></span>
										<span class="right hidden-phone" id="LD30"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD31"></span>
										<span class="right hidden-phone" id="LD31"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD32"></span>
										<span class="right hidden-phone" id="LD32"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD33"></span>
										<span class="right hidden-phone" id="LD33"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD34"></span>
										<span class="right hidden-phone" id="LD34"></span>
									</td>
								</tr>
								<tr>
									<td class="st-c ">
										<ul id="UL28"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL29"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL30"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL31"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL32"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL33"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL34"></ul>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<div class="month-row" style="top: 83.33%; bottom: 0px;">
						<table class="st-bg-table" cellspacing="0" cellpadding="0">
							<tbody>
								<tr>
									<td class="st-bg ">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
									<td class="st-bg">&nbsp;</td>
								</tr>
							</tbody>
						</table>
						<table class="st-grid" cellspacing="0" cellpadding="0">
							<tbody>
								<tr>
									<td class="st-dtitle ">
										<span class="left" id="SD35">1</span>
										&nbsp;
										<span class="right hidden-phone" id="LD35">2</span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD36"></span>
										<span class="right hidden-phone" id="LD36"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD37"></span>
										<span class="right hidden-phone" id="LD37"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD38"></span>
										<span class="right hidden-phone" id="LD38"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD39"></span>
										<span class="right hidden-phone" id="LD39"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD40"></span>
										<span class="right hidden-phone" id="LD40"></span>
									</td>
									<td class="st-dtitle">
										<span class="left" id="SD41"></span>
										<span class="right hidden-phone" id="LD41"></span>
									</td>
								</tr>
								<tr>
									<td class="st-c ">
										<ul id="UL35"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL36"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL37"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL38"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL39"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL40"></ul>
									</td>
									<td class="st-c ">
										<ul id="UL41"></ul>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
	</form>	
</div><div id="dialog2"></div>